<?php

class LogError {
    
    public static function REGISTREER($eid=0,$info='',$bestand='',$lijn='',$code='') {
        $bestandPad = explode(DIRECTORY_SEPARATOR,$bestand);
        $bestand = [];
        $nu = false;
        foreach ($bestandPad as $item) {
            if ($item == 'cms')
                $nu = true;
            if ($nu)
                array_push ($bestand, $item);
        }
        $bestand = implode('/',$bestand);
        
        $info = implode('<br>',['--bestand--',$bestand,
                                '--lijn--',$lijn,
                                '--boodschap--',$info]);
        
        new LogEX(Systeem::LOG_ERROR,$info);
        switch($eid) {
            case E_ERROR:
            case E_WARNING:
            case E_NOTICE:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_ERROR:
            case E_USER_WARNING:
            case E_USER_NOTICE:
            case E_STRICT:
            case E_RECOVERABLE_ERROR:
            case E_ALL:
                
                break;                
            case E_PARSE:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
                die('ERROR<br>'.$info);
        }
    }
}
